<?php 
if(isset($this->session->userdata)) {
	$role = $this->session->userdata('role');
}
?>
<div class="clear_both"></div>
<div class="main_container">
<?php if(!empty($users)):?>
<br />
<div style="width:750px">
<?php echo anchor('user/addUser', 'Add User', 'title="Add User"');?>
<table border="1" cellspacing="0" cellpadding="5" id="members" class="display">
<thead>
			<tr>
				<th width="43%">Email Address/Username</th>
				<th width="43%">Employee Name</th>
				<!-- <th>Password</th> -->
				<th>Action</th>
			</tr>
		</thead>
<?php 

foreach($users as $user) {
	if($user->role == 1 && (isset($role ) && $role != 'superadmin')) continue;
?>

<tr>
	<td><?php echo $user->username?></td>
	<!-- <td><?php echo $user->password?></td> -->
	<td><?php echo $user->first_name .(($user->middle_name)?" {$user->middle_name}":""). (($user->last_name)?" {$user->last_name}":"")?></td>
	<td><a href="<?php echo base_url()."user/file201/{$user->id}"?>" title="View/Edit"><img src="/images/common/edit_icon.png" border="0"></a></td>
</tr>
<?php }?>
</table>
</div>
<?php endif;?>
</div>
<script language="javascript">
$(document).ready(function() {
	$('#members').dataTable({
		"sPaginationType": "full_numbers",
		"iDisplayLength":25
	});
} );
</script>